Data is transferred between the main memory of a computer and an external or peripheral physical file, such as a hard disk or other storage device, through use of file information blocks (FIBs), also referred to as logical files. Each logical file has a file description which is basically a control point for logical operations against the file, and has its own copy of where in the file such an operation is taking place at any given time.
In reading data from or writing data to physical media, one approach has been to perform direct input/output between a computer and such media. In other words, no intermediate or intermediary buffers are used, but instead the user performs physical input/output operations directly from his arrays to the media; the user is then responsible for managing its own buffering. A second approach is where intermediary buffers were used that were private to each logical file. In other words, each buffer is permanently assigned to a physical location in memory. In this approach, if each of two programs has a buffer, then there is no coordination of physical reads and writes, so that until the content of one buffer is written onto physical media, other programs could not be aware of the change. Furthermore, even if the content of a buffer has been forced out to disk, if the content of any corresponding buffer in another program is then not discarded, then that program would see bad data at the buffer instead of the proper data at the disk. For this reason, a private buffer scheme is not a desirable approach where multiple programs or program modules want to share the same physical file. The direct I/O approach could be useable for that purpose, but required some other mechanism for synchronizing or coordinating writes to physical media so that each program or module would know when it had to discard its data and read same again from the media. Accordingly, there exist applications in which there is a need to have two or more separate programs or modules to share one physical file. For such purposes, sharing buffers is preferred. With shared buffers, each buffer services one location or set of locations in the storage device, but is shared with, and can be utilized by any of, multiple programs, users, modules, etc. However, problems have been encountered in that one user might write into a buffer, and then a second user might take some action requiring the buffer to be transferred to physical media. If that transfer failed, the data loss would not be reported to the user or program that originally provided to the shared buffer the data thereby lost. Such a user would accordingly assume that the content of that buffer had been written into the desired storage location, and the future operation of that user would be affected thereby. The present invention avoids this problem.